<?php
/**
 * Created by PhpStorm.
 * User: qttx
 * Date: 2019/5/30
 * Time: 16:47
 */
namespace app\admin\model;
class BalanceModel extends BaseModel
{
    protected $table = "xst_balance";
    protected $rule = [
        'id' => '',
    ];
    protected $msg = [
        'id' => '',
    ];
    /**
     * 充值币
     * $type 1流通币 2循环币
     * $balabce 数量
    */
    public function recharge()
    {
        $type = request()->post('type');
        $balance = request()->post('balance');
        $id = request()->post('id');
        $data = [];
        if($type==1)
        {
            $res = $this->where('uid',$id)->setInc('circulate',$balance);
        }else{
            $res = $this->where('uid',$id)->setInc('circulation',$balance);
        }
        return $res;
    }
}